//
//  TabBar.swift
//  SwiftCode
//
//  Created by yuhus on 2023/12/11.
//

import Foundation
import UIKit

final class TabBar: UITabBar {
  override init(frame: CGRect) {
    super.init(frame: frame)
    
    initView()
  }
  
  required init?(coder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  override func sizeThatFits(_ size: CGSize) -> CGSize {
    var superSize = super.sizeThatFits(size)
    superSize.height = 94
    return superSize
  }
  
  private func initView() {
    [backgroundView, topView].forEach { addSubview($0) }
    backgroundView.snp.makeConstraints { make in
      make.edges.equalToSuperview()
    }
    topView.snp.makeConstraints { make in
      make.height.equalTo(0.5)
      make.top.leading.trailing.equalToSuperview()
    }
  }
  
  private let backgroundView: UIView = {
    let view = UIView()
    view.backgroundColor = .white
    return view
  }()
  
  private let topView: UIView = {
    let view = UIView()
    view.backgroundColor = .neutral7
    return view
  }()
}
